package com.wyc.serviceorder.feign;

import com.wyc.internalCommon.request.CarDTO;
import com.wyc.internalCommon.response.DriverOrderResponse;
import com.wyc.internalCommon.result.ApiResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("service-driver-user")
public interface ServiceDriverUserFeignClient {

    /**
     * 通过试图查询当前城市是否有司机。
     * @param cityCode
     * @return
     */
    @GetMapping("/driver-status/{cityCode}")
    ApiResult<Boolean> queryDriverByCityCode(@PathVariable("cityCode") String cityCode);

    /**
     * 根据车辆id查询可接单的司机信息
     * @param carId
     * @return
     */
    @GetMapping("/get-available-driver/{carId}")
    ApiResult<DriverOrderResponse> getAvailableDriverByCarId(@PathVariable("carId") Long carId);

    /**
     * 根据车辆id查询车辆
     * @param carId
     * @return
     */
    @RequestMapping("/car/{carId}")
    ApiResult<CarDTO> getCarById(@PathVariable("carId") Long carId);

}
